<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('昵称')->unique();
            $table->string('mobile')->comment('手机号')->unique();
            $table->string('sign')->default('')->comment('自我介绍');
            $table->string('avatar')->default('')->comment('头像');
            $table->integer('coins')->default(0)->comment('交易币');
            $table->integer('datanum')->default(0)->comment('模型数');
            $table->boolean('is_vip')->default(0)->comment('是否vip');
            $table->timestamp('vipduetime')->default(DB::raw('CURRENT_TIMESTAMP'))->comment('vip到期时间');
            $table->integer('money')->default(0)->comment('钱(元)');
            $table->string('realname')->default('')->comment('支付宝真实姓名');
            $table->string('alipay_account')->default('')->comment('支付宝账号');
            $table->string('password')->comment('用户密码');
            $table->boolean('is_active')->default(1);
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
